package com.bubbles.workspace.sync.enums;

import java.util.Properties;

/**
 * <p>description:  </p>
 *
 * @author CryptoNeedle
 * @date 2025-06-23
 */
public abstract class Database {
    
    abstract public String getJdbcDriverClass();
    
    abstract protected String getJdbcUrlTemplate(ConnectType connectType);
    
    public String getJdbcUrl(ConnectType connectType, String host, Integer port, String route) {
        return String.format(getJdbcUrlTemplate(connectType), host, port, route);
    }
    
    abstract public Properties getProperties();
    
    abstract public String getDatabaseValidSql();
    
    abstract public String getDatabaseVersionSql();
    
    abstract public String getDatabaseStatisticSql();
    
    abstract public String getTableSql(String sourceDatabaseName);
    
    abstract public String getColumnSql(String sourceDatabaseName);
    
    abstract public String getConstraintPrimarySql(String sourceDatabaseName);
    
    abstract public String getConstraintUniqueSql(String sourceDatabaseName);
    
    abstract public String getConstraintForeignSql(String sourceDatabaseName);
    
    abstract public String getConstraintCheckSql(String sourceDatabaseName);
    
    abstract public String getIndexUniqueSql(String sourceDatabaseName);
    
    abstract public String getDmlTrackSql(String sourceDatabaseName);
}